<HTML><HEAD><TITLE>current_op(-Precedence, -Associativity, -Name)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Syntax Settings</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>current_op(-Precedence, -Associativity, -Name)</H1>
Succeeds if Name is a visible operator with precedence Precedence and
associativity Associativity.


<DL>
<DT><EM>Precedence</EM></DT>
<DD>Integer or variable.
</DD>
<DT><EM>Associativity</EM></DT>
<DD>Atom or variable.
</DD>
<DT><EM>Name</EM></DT>
<DD>Atom or variable.
</DD>
</DL>
<H2>Description</H2>
   Used to check for the existence of a visible operator of precedence
   Precedence with name Name and associativity Associativity.  Alternative
   solutions are returned on backtracking.

<P>
   Precedence is an integer in the range 1 to 1200.

<P>
   Associativity is one of the atoms

<P>
<PRE>
   xfx, xfy, yfx, fx, fy, xf, yf, fxx, fxy.
</PRE>

<H3>Modes and Determinism</H3><UL>
<LI>current_op(-, -, -) is nondet
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Precedence is not an integer.
<DT><EM>(5) type error </EM>
<DD>Associativity is not one of the above atoms.
<DT><EM>(5) type error </EM>
<DD>Name is instantiated but not to an atom.
<DT><EM>(6) out of range </EM>
<DD>Precedence is not in the range 0 to 1200.
</DL>
<H2>Examples</H2>
<PRE>
Success:
   current_op(300, fx, *).

   [eclipse]: current_op(P, A, +).
   P = 500
   A = fx     More? (;)
   P = 500
   A = yfx     More? (;)   % RETURN pressed
   yes.

Fail:
   current_op(10, fx, noop).

Error:
   current_op(prec, fx, +).             (Error 5).
   current_op(100, fff, +).             (Error 5).
   current_op(100, fx, bad(op)).        (Error 5).
   current_op(-1, fx, +).               (Error 6).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/syntax/op-3.html">op / 3</A>
</BODY></HTML>
